package com.dog.framework.mqtt.component;

import com.dog.framework.mqtt.MqttConstant;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;

/**
 * <p>
 * MQTT生产者消息发送接口
 * </p>
 *
 * @author liuxk
 * @since 2023/11/21
 */
@MessagingGateway(defaultRequestChannel = MqttConstant.CHANNEL_NAME_OUT)
public interface MqttGateway {

    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String message);

    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String message, @Header(MqttHeaders.QOS) int qos);

    void sendToMqtt(@Header(MqttHeaders.TOPIC) String topic, String message, @Header(MqttHeaders.QOS) int qos, @Header(MqttHeaders.RETAINED) boolean retained);
}
